(function(win, doc) {
  let search = document.querySelector('.search');

	function init() {
		// getMGoodsHome()
		// getMGoodsHome()
	}
	// 点击搜索获取要查询的数据
	mui('.glass')[0].addEventListener('tap', function(e) {
    e = e || e.event;
		serachHandler()
		
	}, false)
  search.addEventListener('keydown', function (event) {
    if (event.keyCode === 13) {
      serachHandler()
    }
  })
	function serachHandler() {
    let key = search.value
    if (key === "") {
			mui.alert('请输出正确的关键字')
		} else {
			mui.openWindow({
				url: './templates/classify.html?key=' + key,
				id: 'classify.html',
				extras: {
					key: key
				}
      })
    }  
  }
	init()
}(window, document))
